package com.example.demostatementapi.model.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.example.demostatementapi.model.enums.SystemRecordEnum;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 系统信息记录实体类
 *
 * @author Lv
 * @date 2024/07/13
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("system_record")
public class SystemRecordDO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 系统记录类型
     */
    @TableField("record_key")
    private SystemRecordEnum recordKey;

    /**
     * 记录描述
     */
    @TableField("record_remark")
    private String recordRemark;

    /**
     * 创建人id
     */
    @TableField("create_id")
    private Long createId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改人id
     */
    @TableField("update_id")
    private Long updateId;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标识符  0 未删除   1 已删除
     */
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    /**
     * 扩展属性
     */
    @TableField(value = "ext_data", typeHandler = FastjsonTypeHandler.class)
    private Map<String, String> extData;

}
